package com.example.test.api.config;

import com.example.test.api.interceptor.AppFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppFilterConfig {
    @Bean
    public FilterRegistrationBean setFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new AppFilter());
        registration.addUrlPatterns("/getNotes");
        registration.setName("appFilter");
        registration.setOrder(2);
        return registration;
    }
}
